<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>恢复结果 - 数据脱敏工具</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
    <style>
        body {
            padding-top: 2rem;
            padding-bottom: 2rem;
        }
        .result-section {
            margin-bottom: 2rem;
            padding: 1.5rem;
            border-radius: 0.5rem;
            background-color: #f8f9fa;
        }
        pre {
            white-space: pre-wrap;
            word-wrap: break-word;
            background-color: #f5f5f5;
            padding: 1rem;
            border-radius: 0.5rem;
            max-height: 500px;
            overflow-y: auto;
        }
    </style>
</head>
<body>
    <div class="container">
        <header class="mb-5 text-center">
            <h1>法律文档恢复结果</h1>
            <p class="lead">文档已成功恢复为原始内容</p>
        </header>

        {% with messages = get_flashed_messages() %}
            {% if messages %}
                <div class="alert alert-info">
                    <ul class="mb-0">
                        {% for message in messages %}
                            <li>{{ message }}</li>
                        {% endfor %}
                    </ul>
                </div>
            {% endif %}
        {% endwith %}

        <div class="row mb-4">
            <div class="col-md-12">
                <div class="d-flex justify-content-between align-items-center">
                    <h2>恢复文档: {{ filename }}</h2>
                    <div>
                        <a href="{{ url_for('download_file', filename=filename) }}" class="btn btn-primary">
                            <i class="bi bi-download"></i> 下载恢复文档
                        </a>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-12">
                <div class="result-section">
                    <h3>恢复后的文档内容</h3>
                    <pre>{{ unmasked_content }}</pre>
                </div>
            </div>
        </div>

        <div class="row mt-4">
            <div class="col-md-12 text-center">
                <a href="{{ url_for('index') }}" class="btn btn-outline-primary">
                    <i class="bi bi-arrow-left"></i> 返回首页
                </a>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>